/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.sistemas.sse.dao.impl;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import pe.edu.sistemas.sse.dao.IEapDao;
import pe.edu.sistemas.sse.entity.Eap;
import pe.edu.sistemas.sse.util.HibernateUtil;

/**
 *
 * @author laptop-w8
 */
@Repository("EapDao")
public class EapDao implements IEapDao{

    @Autowired
    private SessionFactory sessionFactory;
    @Override
    public boolean agregarEap(Eap eap) {
        return HibernateUtil.agregarEntidad(sessionFactory, eap);
    }

    @Override
    public boolean actualizarEap(Eap eap) {
        return HibernateUtil.actualizarEntidad(sessionFactory, eap);
    }

    @Override
    public Eap obtenerEap(Eap eap) {
        return HibernateUtil.obtenerEntidad(sessionFactory, Eap.class, eap.getId_eap());
    }

    @Override
    public boolean existeEap(Eap eap) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
}
